home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / hstelix2.zip / UP-H.SLT < prev   
Text File  |  1991-11-17  |  2KB  |  50 lines

  1. // Script written by Reuben Sumner on 11-16-91
  2. // Purpose:
  3. //      To allow for uploading of files using the HS/Link protocol
  4. // without having problems with file name expansion for uploads
  5.  
  6. main ()
  7.  
  8. {
  9.     int mpos;                       // position into _ext_filespec
  10.     str _file_name[64];             // file name to be worked upon
  11.     str _cmd_line[128];             // command line to pass to HS/Link
  12.     int itemp;                      // temporary integer
  13.     str stemp[64];                  // temporary string;
  14.     int stop;
  15.  
  16.     stop = 0;
  17.     _cmd_line = "-E";
  18.     itos (get_baud(),stemp);
  19.     strcat (_cmd_line,stemp);
  20.     strcat (_cmd_line," -P");
  21.     itos (get_port(),stemp);
  22.     strcat (_cmd_line,stemp);
  23.     strcat (_cmd_line," -U");
  24.     strcat (_cmd_line,_down_dir);
  25.     strcat (_cmd_line," ");
  26.  
  27.     if (strlen(_ext_filespec) == 0) // download selected not upload
  28.          stop = 1;
  29.  
  30.     while (!stop) {
  31.         itemp = strchr (_ext_filespec,mpos,' '); // search for first space
  32.         if (itemp != -1) {                       // more than one file to go?
  33.             substr (_ext_filespec,mpos,itemp-mpos,_file_name);
  34.                                     // extact the filename
  35.             mpos = itemp + 1;       // next time search starting at after the
  36.                                     // space character
  37.         } else {
  38.             substr (_ext_filespec,mpos,strlen(_ext_filespec)-mpos+1,_file_name);
  39.                                     // get last file name into _file_name
  40.             stop = 1;               // last file name extracted
  41.         }
  42.  
  43.         fnstrip (_file_name,12,stemp); // drive and path only
  44.         if (strlen(stemp) == 0)         // no drive or path
  45.             strcat (_cmd_line,_up_dir); // add upload directory
  46.         strcat (_cmd_line,_file_name);  // add file name
  47.         strcat (_cmd_line," ");        // add space
  48.     }
  49.     run ("HSLINK",_cmd_line,0);       // finally run the sucker
  50. }